package com.navinfo.platform.common.service.impl;

import com.navinfo.platform.common.service.ILoadDataChannel;
import org.apache.spark.sql.SparkSession;

public enum LoadDataFromHive implements ILoadDataChannel {
    //
    INSTANCE;

    @SuppressWarnings("unchecked")
    @Override
    public <T> T readData(SparkSession spark, Object ... param) {
        String sql = (String) param[0];
        return (T) spark.sql(sql);
    }
}
